package com.alex.ioc.annotation.controller;

import com.alex.ioc.annotation.pojo.Car;
import com.alex.ioc.annotation.pojo.NotBean;
import com.alex.ioc.annotation.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class CarController {

    @Autowired(required = false)
    private NotBean notBean;

    @Autowired
    private CarService carService;

    public void execute() {
        System.out.println("controller execute ...");

        carService.add(new Car("benz", 336699));
    }
}
